<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>员工登录</title>
    <link rel="stylesheet" href="/css/font.css">
    <link rel="stylesheet" href="/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/js/xadmin.js"></script>
</head>
<body class="login-bg">

<div class="login">
    <div class="message">酒店后台-员工管理登录</div>
    <div id="darkbannerwrap"></div>
    <hr class="hr15">

    <form method="post" class="layui-form" id="user">
        <input name="staffUsername" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
        <hr class="hr15">
        <input name="staffPwd" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
        <hr class="hr15">
        <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
        <hr class="hr20" >
    </form>

</div>

<script>
    layui.use('form', function(){
        var form = layui.form;

        //用户密码提交
        form.on('submit(login)', function(data){
            $.ajax({
                url:"/login/loginSubmit",
                type:"get",
                data:data.field,
                dataType:"json", //返回类型
                success:function(data){

                    layer.alert(data.info);
                    if(data.info== "登录成功"){
                        //访问主页面
                        location.href="/login/staffLoginMain"
                    }
                }
            })
            return false;
        });
    });


</script>

</body>
</html>